package com.cswangdao.mapper;

import com.cswangdao.domain.model.MarketGoodsAttribute;
import com.cswangdao.domain.po.GoodsAttribute;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface MarketGoodsAttributeMapper {

    /**
     * @description: 批量插入商品属性
     * @param: attributes
     * @return: void
     */
    void insertBatch(List<GoodsAttribute> attributes);

    @Delete("delete from market_goods_attribute where goods_id = #{goodsId} ")
    void deleteByGoodsId(Integer goodsId);

    List<MarketGoodsAttribute> getByGoodsId(@Param("goodsId") int goodsId);

    void updateById(GoodsAttribute goodsAttribute);
}